<?php
// +----------------------------------------------------------------------
// | author: thinkphp
// +----------------------------------------------------------------------

namespace app\api\logic;

use app\common\logic\BaseLogic;
use app\common\model\user\Travelers;


/**
 * 逻辑
 * Class TravelersLogic
 * @package app\api\logic
 */
class TravelersLogic extends BaseLogic
{

    /**
     * @notes 数据
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public static function getAllData(int $userId)
    {
        return Travelers::where('user_id', $userId)->order(['is_default' => 'desc', 'id' => 'desc'])
            ->select()
            ->toArray();
    }
}